import Vue from 'vue'
import Router from 'vue-router'

// 按需加载
const HelloWorld = resolve => require(['@/components/HelloWorld'], resolve)
const NotFound = resolve => require(['@/components/404'], resolve)
const Body = resolve => require(['@/container/Body'], resolve)
const Login = resolve => require(['@/container/Login'], resolve)
// 卡包组件
const CardHolder = resolve => require(['@/container/card/CardHolder'], resolve)
const AddCard = resolve => require(['@/container/card/AddCard'], resolve)
const Recommend = resolve => require(['@/container/card_link/Recommend'], resolve)
const Mcc = resolve => require(['@/container/card_link/Mcc'], resolve)
const MultiScore = resolve => require(['@/container/card_link/MultiScore'], resolve)
const MccKnowledge = resolve => require(['@/container/card_link/MccKnowledge'], resolve)
const Phone = resolve => require(['@/container/card_link/Phone'], resolve)
const Forum = resolve => require(['@/container/card_link/Forum'], resolve)
const ApplyCard = resolve => require(['@/container/card_link/ApplyCard'], resolve)
const BankCard = resolve => require(['@/container/card_link/BankCard'], resolve)
// 活动组件
const Activity = resolve => require(['@/container/activity/Activity'], resolve)
const ActivityDel = resolve => require(['@/container/activity/ActivityDel'], resolve)
const ActivityGrab = resolve => require(['@/container/activity/ActivityGrab'], resolve)
const ActivityDetail = resolve => require(['@/container/activity/ActivityDetail'], resolve)
const ActivityComment = resolve => require(['@/container/activity/ActivityComment'], resolve)
const ReportList = resolve => require(['@/container/activity_link/ReportList'], resolve)
const ReportDetail = resolve => require(['@/container/activity_link/ReportDetail'], resolve)
const ReportDetailShare = resolve => require(['@/container/activity_link/ReportDetailShare'], resolve)
const MyReport = resolve => require(['@/container/activity_link/MyReport'], resolve)
const MyReportAdd = resolve => require(['@/container/activity_link/MyReportAdd'], resolve)
const MyActivity = resolve => require(['@/container/activity_link/MyActivity'], resolve)
const MyActivityAdd = resolve => require(['@/container/activity_link/MyActivityAdd'], resolve)
// 权益交易
const Trade = resolve => require(['@/container/trade/Trade'], resolve)
const BuyDetail = resolve => require(['@/container/trade/BuyDetail'], resolve)
const SellDetail = resolve => require(['@/container/trade/SellDetail'], resolve)
const Pay = resolve => require(['@/container/trade/Pay'], resolve)
const PayPlatform = resolve => require(['@/container/trade/PayPlatform'], resolve)
const Cooperation = resolve => require(['@/container/trade/Cooperation'], resolve)
const CooperationList = resolve => require(['@/container/trade/CooperationList'], resolve)
const BroadCast = resolve => require(['@/container/trade/BroadCast'], resolve)
const BroadCastDetail = resolve => require(['@/container/trade/BroadCastDetail'], resolve)
// 个人中心
const UserCenter = resolve => require(['@/container/user/UserCenter'], resolve)
const Wallet = resolve => require(['@/container/user/Wallet'], resolve)
const WalletBind = resolve => require(['@/container/user/WalletBind'], resolve)
const WalletReset = resolve => require(['@/container/user/WalletReset'], resolve)
const WalletDetail = resolve => require(['@/container/user/WalletDetail'], resolve)
const WithdrawCash = resolve => require(['@/container/user/WithdrawCash'], resolve)
const Buy = resolve => require(['@/container/user/Buy'], resolve)
const Sell = resolve => require(['@/container/user/Sell'], resolve)
const OrderDetail = resolve => require(['@/container/user/OrderDetail'], resolve)
const SellOrderDetail = resolve => require(['@/container/user/SellOrderDetail'], resolve)
const GoodsDetail = resolve => require(['@/container/user/GoodsDetail'], resolve)
const Achieve = resolve => require(['@/container/user/Achieve'], resolve)
const Setting = resolve => require(['@/container/user/Setting'], resolve)
const Helper = resolve => require(['@/container/user/Helper'], resolve)
const HelperDetail = resolve => require(['@/container/user/HelperDetail'], resolve)
const TakeGoodsRecord = resolve => require(['@/container/user/TakeGoodsRecord'], resolve)
const FeedBack = resolve => require(['@/container/user/FeedBack'], resolve)
const Invite = resolve => require(['@/container/user/Invite'], resolve)
const InviteList = resolve => require(['@/container/user/InviteList'], resolve)
const ProfitList = resolve => require(['@/container/user/ProfitList'], resolve)
const BonusList = resolve => require(['@/container/user/BonusList'], resolve)
// 惠币商城
const SignIn = resolve => require(['@/container/user/SignIn'], resolve)
const Mall = resolve => require(['@/container/user/Mall'], resolve)
const MallDetail = resolve => require(['@/container/user/MallDetail'], resolve)
const HuiDetail = resolve => require(['@/container/user/HuiDetail'], resolve)
const HuiMine = resolve => require(['@/container/user/HuiMine'], resolve)
// 说明
const ExplainBill = resolve => require(['@/container/explain/ExplainBill'], resolve)
const ExplainCard = resolve => require(['@/container/explain/ExplainCard'], resolve)
const ExplainTrade = resolve => require(['@/container/explain/ExplainTrade'], resolve)
const ExplainReport = resolve => require(['@/container/explain/ExplainReport'], resolve)
const ExplainCoupon = resolve => require(['@/container/explain/ExplainCoupon'], resolve)
// 其他
const TakeGoods = resolve => require(['@/container/other/TakeGoods'], resolve)
const TurnTable = resolve => require(['@/container/other/TurnTable'], resolve)
const Share = resolve => require(['@/container/other/Share'], resolve)
const ShareReg = resolve => require(['@/container/other/ShareReg'], resolve)
// 撸撸机
const LljList = resolve => require(['@/container/llj/LljList'], resolve)
const LljAdd = resolve => require(['@/container/llj/LljAdd'], resolve)
const LljPay = resolve => require(['@/container/llj/LljPay'], resolve)
const LljExplain = resolve => require(['@/container/llj/LljExplain'], resolve)
// 浦发红包
const Robot = resolve => require(['@/container/robot/Index'], resolve)
const RedPacket = resolve => require(['@/container/robot/RedPacket'], resolve)
const RobotJournal = resolve => require(['@/container/robot/Journal'], resolve)
const RobotReport = resolve => require(['@/container/robot/Report'], resolve)
const RobotPay = resolve => require(['@/container/robot/Pay'], resolve)

Vue.use(Router)

export default new Router({
  // mode: 'history',
  routes: [
    {
      path: '/helloworld',
      name: 'HelloWorld',
      component: HelloWorld,
      meta: {title: '欢迎页面', level: 0}
    },
    {
      path: '*',
      name: 'NotFound',
      component: NotFound,
      meta: {title: '页面不存在', level: 0}
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
      meta: {title: '登录', level: 0}
    },
    {
      path: '/',
      name: 'Index',
      redirect: {name: 'App', level: 0}
    },
    {
      path: '/entry',
      name: 'App',
      component: Body,
      redirect: {
        name: 'CardHolder'
      },
      children: [
        {path: 'cardHolder', name: 'CardHolder', component: CardHolder, meta: {title: '卡包', level: 1}},
        {path: 'activity', name: 'Activity', component: Activity, meta: {title: '活动', level: 2}},
        {path: 'trade', name: 'Trade', component: Trade, meta: {title: '交易', level: 3}},
        {path: 'personal', name: 'Personal', component: UserCenter, meta: {title: '个人中心', level: 4}},
        {path: 'buy/:tab', name: 'Buy', component: Buy, meta: {title: '我的买单', level: 404}},
        {path: 'sell/:tab', name: 'Sell', component: Sell, meta: {title: '我的卖单', level: 404}}
      ]
    },
    // 卡包链接组件---start
    {
      path: '/addCard',
      component: AddCard,
      name: 'AddCard',
      meta: {title: '卡片添加', level: 101}
    },
    {
      path: '/addCard/:id',
      component: AddCard,
      name: 'EditCard',
      meta: {title: '卡片修改', level: 102}
    },
    {
      path: '/recommend',
      name: 'Recommend',
      component: Recommend,
      meta: {title: '办卡推荐', level: 111}
    },
    {
      path: '/mcc',
      name: 'Mcc',
      component: Mcc,
      meta: {title: 'mcc查询', level: 112}
    },
    {
      path: '/phone',
      name: 'Phone',
      component: Phone,
      meta: {title: '银行客服电话', level: 113}
    },
    {
      path: '/forum',
      name: 'Forum',
      component: Forum,
      meta: {title: '玩卡讲堂', level: 114}
    },
    {
      path: '/applyCard/:type/:id',
      name: 'ApplyCard',
      component: ApplyCard,
      meta: {title: '银行卡申请', level: 121}
    },
    {
      path: '/MccKnowledge',
      name: 'MccKnowledge',
      component: MccKnowledge,
      meta: {title: 'Mcc常识', level: 122}
    },
    {
      path: '/multiScore',
      name: 'MultiScore',
      component: MultiScore,
      meta: {title: '多倍积分', level: 123}
    },
    {
      path: '/bankCard/:id',
      name: 'BankCard',
      component: BankCard,
      meta: {title: '银行卡详情', level: 131}
    },
    // 卡包链接组件---end
    // 活动链接组件---start
    {
      path: '/activityGrab',
      component: ActivityGrab,
      name: 'ActivityGrab',
      meta: {title: '抢兑活动', level: 201}
    },
    {
      path: '/activityDetail/:id',
      component: ActivityDetail,
      name: 'ActivityDetail',
      meta: {title: '活动详情', level: 202}
    },
    {
      path: '/activityComment/:id',
      component: ActivityComment,
      name: 'ActivityComment',
      meta: {title: '活动评论', level: 203}
    },
    {
      path: '/activityDel',
      component: ActivityDel,
      name: 'ActivityDel',
      meta: {title: '删除活动', level: 204}
    },
    {
      path: '/reportList',
      name: 'ReportList',
      component: ReportList,
      meta: {title: '线报列表', level: 211}
    },
    {
      path: '/reportDetail/:id',
      name: 'ReportDetail',
      component: ReportDetail,
      meta: {title: '线报详情', level: 221}
    },
    {
      path: '/reportDetailShare/:id',
      name: 'ReportDetailShare',
      component: ReportDetailShare,
      meta: {title: '线报详情', level: 249}
    },
    {
      path: '/myReport',
      name: 'MyReport',
      component: MyReport,
      meta: {title: '我的爆料', level: 212}
    },
    {
      path: '/myReportAdd',
      name: 'MyReportAdd',
      component: MyReportAdd,
      meta: {title: '我要爆料', level: 222}
    },
    {
      path: '/myActivity',
      name: 'MyActivity',
      component: MyActivity,
      meta: {title: '活动补充', level: 213}
    },
    {
      path: '/myActivityAdd',
      name: 'MyActivityAdd',
      component: MyActivityAdd,
      meta: {title: '我要补充', level: 223}
    },
    {
      path: '/share',
      name: 'Share',
      component: Share,
      meta: {title: '我要分享', level: 250}
    },
    {
      path: '/shareReg',
      name: 'ShareReg',
      component: ShareReg,
      meta: {title: '惠权益', level: 250}
    },
    // 活动链接组件---end
    // 权益交易组件---start
    {
      path: '/broadCast',
      name: 'BroadCast',
      component: BroadCast,
      meta: {title: '权益播报', level: 301}
    },
    {
      path: '/broadCastDetail/:id',
      name: 'BroadCastDetail',
      component: BroadCastDetail,
      meta: {title: '权益播报', level: 311}
    },
    {
      path: '/cooperationList',
      name: 'CooperationList',
      component: CooperationList,
      meta: {title: '券商合作', level: 302}
    },
    {
      path: '/cooperation',
      name: 'Cooperation',
      component: Cooperation,
      meta: {title: '券商合作', level: 313}
    },
    {
      path: '/buyDetail/:id',
      name: 'BuyDetail',
      component: BuyDetail,
      meta: {title: '', level: 315}
    },
    {
      path: '/sellDetail/:id',
      name: 'SellDetail',
      component: SellDetail,
      meta: {title: '', level: 316}
    },
    {
      path: '/pay/:id',
      name: 'Pay',
      component: Pay,
      meta: {title: '订单待支付', level: 500}
    },
    {
      path: '/payPlatform/:id',
      name: 'PayPlatform',
      component: PayPlatform,
      meta: {title: '订单待支付', level: 501}
    },
    // 权益交易组件---end
    // 用户中心组件---start
    {
      path: '/wallet',
      name: 'Wallet',
      component: Wallet,
      meta: {title: '我的钱包', level: 403}
    },
    {
      path: '/walletBind',
      name: 'WalletBind',
      component: WalletBind,
      meta: {title: '绑定支付宝', level: 411}
    },
    {
      path: '/walletReset',
      name: 'WalletReset',
      component: WalletReset,
      meta: {title: '修改支付宝', level: 412}
    },
    {
      path: '/walletDetail/:type',
      name: 'WalletDetail',
      component: WalletDetail,
      meta: {title: '钱包明细', level: 413}
    },
    {
      path: '/withdrawCash',
      name: 'WithdrawCash',
      component: WithdrawCash,
      meta: {title: '提现', level: 414}
    },
    {
      path: '/orderDetail/:id',
      name: 'OrderDetail',
      component: OrderDetail,
      meta: {title: '', level: 415}
    },
    {
      path: '/goodsDetail/:id',
      name: 'GoodsDetail',
      component: GoodsDetail,
      meta: {title: '', level: 415}
    },
    {
      path: '/sellOrderDetail/:id',
      name: 'SellOrderDetail',
      component: SellOrderDetail,
      meta: {title: '', level: 415}
    },
    {
      path: '/achieve',
      name: 'Achieve',
      component: Achieve,
      meta: {title: '我的成就', level: 405}
    },
    {
      path: '/setting',
      name: 'Setting',
      component: Setting,
      meta: {title: '提醒设置', level: 407}
    },
    {
      path: '/invite',
      name: 'Invite',
      component: Invite,
      meta: {title: '邀请好友', level: 408}
    },
    {
      path: '/inviteList',
      name: 'InviteList',
      component: InviteList,
      meta: {title: '邀请列表', level: 416}
    },
    {
      path: '/profitList',
      name: 'ProfitList',
      component: ProfitList,
      meta: {title: '分润明细', level: 416}
    },
    {
      path: '/bonusList',
      name: 'BonusList',
      component: BonusList,
      meta: {title: '额外奖励', level: 416}
    },
    {
      path: '/helper',
      name: 'Helper',
      component: Helper,
      meta: {title: '帮助中心', level: 409}
    },
    {
      path: '/helperDetail/:id',
      name: 'HelperDetail',
      component: HelperDetail,
      meta: {title: '帮助中心', level: 420}
    },
    {
      path: '/takeGoodsRecord',
      name: 'TakeGoodsRecord',
      component: TakeGoodsRecord,
      meta: {title: '提货记录', level: 409}
    },
    {
      path: '/feedBack',
      name: 'FeedBack',
      component: FeedBack,
      meta: {title: '意见反馈', level: 409}
    },
    {
      path: '/signIn',
      name: 'SignIn',
      component: SignIn,
      meta: {title: '签到', level: 417}
    },
    {
      path: '/mall',
      name: 'Mall',
      component: Mall,
      meta: {title: '惠币商城', level: 417}
    },
    {
      path: '/mallDetail/:id',
      name: 'MallDetail',
      component: MallDetail,
      meta: {title: '惠币商城', level: 421}
    },
    {
      path: '/huiDetail',
      name: 'HuiDetail',
      component: HuiDetail,
      meta: {title: '惠币商城', level: 422}
    },
    {
      path: '/huiMine',
      name: 'HuiMine',
      component: HuiMine,
      meta: {title: '惠币商城', level: 423}
    },
    // 用户中心组件---end
    // 使用说明 ---start
    {
      path: '/explainBill',
      name: 'ExplainBill',
      component: ExplainBill,
      meta: {title: '销账单使用说明', level: 501}
    },
    {
      path: '/explainCard',
      name: 'ExplainCard',
      component: ExplainCard,
      meta: {title: '卡包使用说明', level: 502}
    },
    {
      path: '/explainTrade',
      name: 'ExplainTrade',
      component: ExplainTrade,
      meta: {title: '权益交易使用说明', level: 503}
    },
    {
      path: '/explainReport',
      name: 'ExplainReport',
      component: ExplainReport,
      meta: {title: '线报使用说明', level: 504}
    },
    {
      path: '/explainCoupon',
      name: 'ExplainCoupon',
      component: ExplainCoupon,
      meta: {title: '券商操作指南', level: 505}
    },
    // 使用说明 ---end
    // llj---start
    {
      path: '/lljList',
      name: 'LljList',
      component: LljList,
      meta: {title: '申请列表', level: 441}
    },
    {
      path: '/lljAdd/:type',
      name: 'LljAdd',
      component: LljAdd,
      meta: {title: '申请POS', level: 442}
    },
    {
      path: '/lljPay/:id/:type',
      name: 'LljPay',
      component: LljPay,
      meta: {title: 'POS机付款', level: 443}
    },
    {
      path: '/lljExplain/:type',
      name: 'LljExplain',
      component: LljExplain,
      meta: {title: 'POS机领取说明', level: 444}
    },
    // llj ---end
    // robot  ---start
    {
      path: '/robot',
      name: 'Robot',
      component: Robot,
      meta: {title: '红包机器人', level: 701}
    },
    {
      path: '/redPacket/:type',
      name: 'RedPacket',
      component: RedPacket,
      meta: {title: '红包机器人', level: 702}
    },
    {
      path: '/robotJournal',
      name: 'RobotJournal',
      component: RobotJournal,
      meta: {title: '红包出售记录', level: 703}
    },
    {
      path: '/robotReport/:id',
      name: 'RobotReport',
      component: RobotReport,
      meta: {title: '被举报详情', level: 704}
    },
    {
      path: '/robotPay/:id',
      name: 'RobotPay',
      component: RobotPay,
      meta: {title: '购买红包订单', level: 705}
    },
    // robot  ---end
    {
      path: '/takeGoods',
      name: 'TakeGoods',
      component: TakeGoods,
      meta: {title: '券商提货', level: 600}
    },
    {
      path: '/turnTable',
      name: 'TurnTable',
      component: TurnTable,
      meta: {title: '会员抽奖', level: 600}
    }
  ]
})
